define(function(require, exports, module) {
  var common = require('common'),
      lang = require('lang');
  module.exports = Backbone.Model.extend({
    defaults: {
      itsm: '',
      title: '',
      detail: '',
      start: moment().format(common.format.moment.date),
      end: moment().format(common.format.moment.date),
      hours: 0,
      priority: 2,
      country: '',
      category: ''
    },
    idAttribute: 'objectId',
    validate: function(attrs, options) {
      if(_.isEmpty(attrs.title)) return lang.get('title') + lang.get('not_allowed_empty');
      if(_.isEmpty(attrs.itsm)) return lang.get('itsm', 'todo') + lang.get('not_allowed_empty');
      if(parseFloat(attrs.hours) < 0) return lang.get('hours', 'todo') + lang.get('not_allowed_empty');
      if(_.isEmpty(attrs.country)) return lang.get('country') + lang.get('not_allowed_empty');
      if(_.isEmpty(attrs.category)) return lang.get('category') + lang.get('not_allowed_empty');
    }
  });
});